<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="../../css/public.css" media="all">
    <style>
        .layui-table-click{
            background-color: #93e293;
        }
    </style>
</head>

<body>
    <div class="layuimini-container">
        <div class="layuimini-main">

            <fieldset class="table-search-fieldset">
                <legend>搜索信息</legend>
                <div style="margin: 10px 10px 10px 10px">
                    <form class="layui-form layui-form-pane" action="">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">图标名称</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="iconName" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <button type="submit" class="layui-btn layui-btn-primary" lay-submit
                                    lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
                            </div>
                        </div>
                    </form>
                </div>
            </fieldset>
            <script type="text/html" id="toolbarDemo">
                <div class="layui-inline" lay-event="add"><i class="layui-icon layui-icon-add-1"></i></div><div class="layui-inline" lay-event="delete"><i class="layui-icon layui-icon-delete"></i></div>
            </script>
            <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
            <script type="text/html" id="currentTableBar">
                <div class="layui-btn layui-btn-primary layui-btn-xs data-count-edit" lay-event="edit"><i class="layui-icon layui-icon-edit"></i></div><div class="layui-btn layui-btn-primary layui-btn-xs data-count-delete" lay-event="delete"><i class="layui-icon layui-icon-delete"></i></div>
            </script>
        </div>
    </div>
    <script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
    <script src="../../js/lay-config.js?v=2.0.0" charset="utf-8"></script>
    <script>
        var tableConfig = {
            //表格编辑模式，0新增，1编辑
            editMode:0,
            //表格idx
            tableIdx:0,
            //弹出窗idx
            editFormIdx:0,
            // 表格请求数据地址
            deleteOneUrl:"/dicms/api/desktop/sys_icon/deleteOne",
            deleteOneToManyUrl: "/dicms/api/desktop/sys_icon/deleteMany",
            addPageUrl:'../../page/icon/edit.html',
            editPageUrl:'../../page/icon/edit.html',
            tableOptions: {
                elem: '#currentTableId',
                url: '/dicms/api/desktop/sys_icon/findByPage',
                height:'',
                //定义请求格式参数
                request: {
                    pageName: 'pageNum' //页码的参数名称，默认：page
                    ,limitName: 'pageSize' //每页数据量的参数名，默认：limit
                },
                //定义响应格式参数
                response: {
                    statusName: 'code' //规定数据状态的字段名称，默认：code
                    , statusCode: 0 //规定成功的状态码，默认：0
                    , msgName: 'msg' //规定状态信息的字段名称，默认：msg
                    , countName: 'count' //规定数据总数的字段名称，默认：count
                    , dataName: 'data' //规定数据列表的字段名称，默认：data
                },
                toolbar:  '#toolbarDemo',//'default',
                defaultToolbar: ['filter', 'exports', 'print', {
                    title: '提示',
                    layEvent: 'LAYTABLE_TIPS',
                    icon: 'layui-icon-tips'
                }],
                cols: [[
                    { type: "checkbox", width: 50 },
                    { field: 'id', width: 80, title: 'ID', sort: true },
                    { field: 'iconName', title: '图标名' },
                    { field: 'sort', title: '排序值', sort: true },
                    { title: '操作',width: 120,toolbar: '#currentTableBar', align: "center" }
                ]],
                limits: [10, 15, 20, 25, 50, 100],
                limit: 10,
                where: { //设定异步数据接口的额外参数，任意设
                    searchParams: "{}"
                },
                page: {
                    curr:1
                },
                skin: 'line'
            }
        };
        layui.use(['common'], function () {
            layui.common.initTableView(tableConfig);
        });
    </script>

</body>

</html>